package bean;

import java.util.ArrayList;

import Dao.TDao;
import bean.Student;

public class Teacher {
	private String tea_id;
	private String tea_name;
	private String tea_pwd;
	private ArrayList<Student> student = new ArrayList<Student>();
	private ArrayList<S_Course> course = new ArrayList<S_Course>();
	private ArrayList<S_Class> cla = new ArrayList<S_Class>();
	private String tea_sex;
	private ArrayList<String> year = new ArrayList<>();
	private ArrayList<String> clas = new ArrayList<>();
	
	public ArrayList<String> getClas() {
		return clas;
	}
	public void setClas(String clas) {
		this.clas.add(clas);
	}
	public ArrayList<String> getYear() {
		return year;
	}
	public void setYear(ArrayList<String> year) {
		this.year = year;
	}
	public String getTea_id() {
		return tea_id;
	}
	public void setTea_id(String tea_id) {
		this.tea_id = tea_id;
	}
	public String getTea_name() {
		return tea_name;
	}
	public void setTea_name(String tea_name) {
		this.tea_name = tea_name;
	}
	public String getTea_pwd() {
		return tea_pwd;
	}
	public void setTea_pwd(String tea_pwd) {
		this.tea_pwd = tea_pwd;
	}
	public String getTea_sex() {
		return tea_sex;
	}
	public void setTea_sex(String tea_sex) {
		this.tea_sex = tea_sex;
	}
	public ArrayList<Student> getStudent() {
		return student;
	}
	public void setStudent(ArrayList<Student> student) {
		this.student = student;
	}
	public ArrayList<S_Course> getCourse() {
		return course;
	}
	public void setCourse(ArrayList<S_Course> course) {
		this.course = course;
	}
	public ArrayList<S_Class> getCla() {
		return cla;
	}
	public void setCla(ArrayList<S_Class> cla) {
		this.cla = cla;
	}
	
	
	public void setClass(String cla_id ,String cla_name) {

		S_Class cla = new S_Class();
		cla.setCla_id(cla_id);
		cla.setCla_name(cla_name);
		this.cla.add(cla);
	}
	public void setStudent(String stu_name , double grade) {

		Student stu = new Student();
		stu.setStu_name(stu_name);
		/*System.out.println(stu_name+"111");*/
		stu.setGrade(grade);
		/*System.out.println(grade+"111");*/
		this.student.add(stu);
		/*System.out.println(this.student.get(0).getStu_name());
		System.out.println(this.student.get(0).getGrade());*/
	}
	public void setCourse(String c_id , String c_name) {

		S_Course cou = new S_Course();
		cou.setC_name(c_name);
		cou.setC_id(c_id);
		this.course.add(cou);
	}
	public Teacher ScoreForGrade(String tea_id , String year) throws Exception
	{
		TDao s = new TDao();
		Teacher tea = s.GetSco(tea_id ,year);
		return tea;
	}
	
	public Teacher TeaClassTable(String tea_id , String year) throws Exception
	{
		TDao s = new TDao();
		Teacher tea = s.TeaClassTable(tea_id ,year);
		return tea;
	}
	public Teacher TeaClaTab(String tea_id , String year) throws Exception
	{
		TDao s = new TDao();
		Teacher tea = s.TeaClaTab(tea_id ,year);
		return tea;
	}
	public Teacher ChangeData(String tea_id,String cla_id , String c_id , String year) throws Exception
	{
		TDao s = new TDao();
		Teacher tea = s.ChangeData(tea_id,cla_id, c_id , year);
		//System.out.println(tea.getStudent().get(0).getStu_name());
		//System.out.println(tea.getStudent().get(0).getGrade());
		return tea;
	}
	
	public void setClaTab(String c_name ,String c_time , double c_point ,int g_id) {

		S_Course cou = new S_Course();
		cou.setC_name(c_name);
		cou.setC_point(c_point);
		cou.setC_time(c_time);
		cou.setG_id(g_id);
		this.course.add(cou);
	}
}
